package com.xjh.him.controller;

import com.xjh.him.annotation.LoginVerify;
import com.xjh.him.dto.usergroupmember.UserGroupMemberDTO;
import com.xjh.him.service.UserGroupMemberServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.xjh.tool.dto.ResultDTO;
import org.xjh.tool.vo.AjaxResultVO;

import java.util.List;

@RestController
@RequestMapping("/user/group/member")
public class UserGroupMemberController {

    @Autowired
    private UserGroupMemberServiceImpl userGroupMemberService;


    @LoginVerify
    @RequestMapping("/list")
    public AjaxResultVO listMember(Long groupId) {
        ResultDTO<List<UserGroupMemberDTO>> resultDTO = userGroupMemberService.listMember(groupId);
        if (resultDTO.isSuccess()) {
            return AjaxResultVO.getSuccessResult(resultDTO.getResult());
        }
        return AjaxResultVO.getFailureResult(resultDTO.getErrMsg());
    }
}
